<div class="row">
    <div class="col s12" dw-loading="tableProductLoading">
        <div class="pd10">

            <table class="responsive-table centered bordered" ng-if="vm.getType == 'product'">
                <thead>
                    <tr>
                        <th class="pigTh">商品</th>
                        <th>标题</th>
                        <th>店铺</th>
                        <th>品牌</th>
                        <th ng-click="vm.sort('sell_money','down')">
                            <span class="cp">近30天销售额</span>
                            <i class="caret down icon cp" ng-class="{'caret down icon cp':true,'green-text':vm.pagination.sortColumn == 'sell_money'}"></i>
                        </th>
                        <th ng-click="vm.sort('sell_amount','down')">
                            <span class="cp">近30天销售量</span>
                            <i class="caret down icon cp" ng-class="{'caret down icon cp':true,'green-text':vm.pagination.sortColumn == 'sell_amount'}"></i>
                        </th>
                        <th>
                            <span>价格</span>
                            <!-- <i class="caret down icon cp" ng-class="{'caret down icon cp':true,'green-text':vm.filter.sortColumn == 'price'}"></i> -->
                        </th>
                        <th>监控数据</th>
                        <th>货源</th>
                        <th>监控</th>
                    </tr>
                </thead>
                <tbody>
                    <tr class="repeat-item" ng-repeat="prod in vm.table.products track by $index ">
                        <td ng-if="prod.numberId">
                            <a href="https://item.taobao.com/item.htm?id={{prod.numberId}}" target="_blank">
                                <img ng-src="{{prod.picUrl}}" class="w65">
                            </a>
                        </td>
                        <td ng-if="prod.numberId">
                            <a class="truncate" style="max-width: 200px;overflow: hidden;" title="{{prod.title}}" href="https://item.taobao.com/item.htm?id={{prod.numberId}}" target="_blank" ng-bind-html="prod.title | highlight:vm.filter.title"></a>
                        </td>
                        <!-- 店铺 -->
                        <td class="detailData cp" ng-if="prod.numberId" ng-click="vm.getShopBasic($event,$index)">
                            <a href="http://store.taobao.com/shop/view_shop.htm?user_number_id={{prod.uid}}" target="_blank">{{prod.nick}}</a>
                        </td>
                        <!-- 品牌 -->
                        <td ng-if="prod.numberId && !prod.brandName">-</td>
                        <td class="detailData cp" ng-if="prod.numberId && prod.brandName" ng-click="vm.getBrandBasic($event,$index)">
                            {{prod.brandName || '-'}}
                        </td>
                        <td ng-if="prod.numberId" class="hisData cp"  dim="sellMoney" jq-popup popup-config="prod" popup-type="'product'" popup-dim="'sellMoney'"
                        uib-popover-template="'myPopoverTemplate.html'" popover-class="popover_line" popover-trigger="'outsideClick'" popover-append-to-body="true" popover-enable='{{vm.popoverEnable}}'>{{prod.sellMoney | bigNum}}</td>
                        <td ng-if="prod.numberId" class="hisData cp"  dim="sellAmount" jq-popup popup-config="prod" popup-type="'product'" popup-dim="'sellAmount'"
                        uib-popover-template="'myPopoverTemplate.html'" popover-class="popover_line" popover-trigger="'outsideClick'" popover-append-to-body="true" popover-enable='{{vm.popoverEnable}}'>{{prod.sellAmount | bigNum}}</td>
                        <td ng-if="prod.numberId" class="hisData cp" jq-popup popup-config="prod" popup-type="'product'" popup-dim="'price'"
                        uib-popover-template="'myPopoverTemplate.html'" popover-class="popover_line" popover-trigger="'outsideClick'" popover-append-to-body="true" popover-enable='{{vm.popoverEnable}}'>{{prod.price}}</td>
                        <td ng-if="prod.numberId" title="点击查看历史数据" class="cp" ng-click="vm.getMonitorData($event,$index)">
                            <i class="fa fa-line-chart" style="font-size: 16px;"></i>
                        </td>
                        <td ng-if="prod.numberId" class="cp" emit-product-source emit-prod="prod">
                            <a href="javascript:void(0);">商品货源</a>
                        </td>
                        <td ng-if="prod.numberId" class="monitorTd" add-monitor add-monitor-config="prod" add-monitor-type="'product'">
                            <i class="fa cp" ng-class="{'fa-toggle-on':prod.collectionStatus,'fa-toggle-off':!prod.collectionStatus}"></i>
                        </td>
                        <td ng-if="prod.monitorDetail" colspan="10">
                            <!-- 店铺详情 -->
                            <shop-stat-data-component shop-uid="prod.uid" ng-if="prod.uid"></shop-stat-data-component>
                            <!-- 品牌详情 -->
                            <brand-stat-data-component brand-name="prod.brandname" ng-if="prod.brandname"></brand-stat-data-component>
                            <!-- 日监控数据 -->
                            <monitor-day-component class="monitorDetail" target-id="prod.targetId" monitor-day-type="'product'" ng-if="prod.targetId"></monitor-day-component>
                        </td>
                    </tr>
                    <tr ng-if="vm.table.products.length == 0">
                        <td colspan="10">
                            暂无数据
                        </td>
                    </tr>
                </tbody>
            </table>
            <div class="center-align pd10" ng-if="vm.getType == 'product'">
                <pager page-count="vm.pager.pageCount" current-page="vm.pager.currentPage" on-page-change="vm.pager.onPageChange()" show-goto="true"></pager>
            </div>
            <!-- monitor.controller -->
            <table class="responsive-table centered bordered" ng-if="vm.getType=='monitorProduct'">
                <thead>
                    <tr>
                        <th class="pigTh">商品</th>
                        <th>标题</th>
                        <th>店铺</th>
                        <th>品牌</th>
                        <th>近30天销售额</th>
                        <th>近30天销售量</th>
                        <th>价格</th>
                        <th>监控数据</th>
                        <th>货源</th>
                        <th>取消监控</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="prod in vm.table.products">
                        <td ng-if="prod.numberId">
                            <a href="https://item.taobao.com/item.htm?id={{prod.numberId}}" target="_blank">
                                <img ng-src="{{prod.picUrl}}" class="w65">
                            </a>
                        </td>
                        <td ng-if="prod.numberId">
                            <a class="truncate" style="max-width: 200px;overflow: hidden;" title="{{prod.title}}" href="https://item.taobao.com/item.htm?id={{prod.numberId}}" target="_blank" ng-bind-html="prod.title | highlight:vm.filter.title"></a>
                        </td>
                        <!-- 店铺 -->
                        <td class="detailData cp" ng-if="prod.numberId" ng-click="vm.getShopBasic($event,$index)">
                            <a href="http://store.taobao.com/shop/view_shop.htm?user_number_id={{prod.uid}}" target="_blank">{{prod.nick}}</a>
                        </td>
                        <!-- 品牌 -->
                        <td ng-if="prod.numberId && !prod.brandName">-</td>
                        <td class="detailData cp" ng-if="prod.numberId && prod.brandName" ng-click="vm.getBrandBasic($event,$index)">
                            {{prod.brandName || '-'}}
                        </td>
                        <td ng-if="prod.numberId" class="hisData cp" dim="sellMoney" jq-popup popup-config="prod" popup-type="'product'" popup-dim="'sellMoney'">{{prod.sellMoney | bigNum}}</td>
                        <td ng-if="prod.numberId" class="hisData cp" dim="sellAmount" jq-popup popup-config="prod" popup-type="'product'" popup-dim="'sellAmount'">{{prod.sellAmount | bigNum}}</td>
                        <td ng-if="prod.numberId" class="hisData cp" dim="price" jq-popup popup-config="prod" popup-type="'product'" popup-dim="'price'">{{prod.price}}</td>
                        <td ng-if="prod.numberId" title="点击查看历史数据" class="cp" ng-click="vm.getMonitorData($event,$index)">
                            <i class="fa fa-line-chart" style="font-size: 16px;"></i>
                        </td>
                        <td ng-if="prod.numberId" class="cp" emit-product-source emit-prod="prod">
                            <a href="javascript:void(0);">商品货源</a>
                        </td>
                        <td ng-if="prod.numberId" class="monitorTd" ng-click="vm.deleteCollection(prod)">
                            <i class="fa fa-trash-o"></i>
                        </td>
                        <td ng-if="prod.monitorDetail" colspan="10">
                            <!-- 店铺详情 -->
                            <shop-stat-data-component shop-uid="prod.uid" ng-if="prod.uid"></shop-stat-data-component>
                            <!-- 品牌详情 -->
                            <brand-stat-data-component brand-name="prod.brandname" ng-if="prod.brandname"></brand-stat-data-component>
                            <!-- 日监控数据 -->
                            <monitor-day-component target-id="prod.targetId" monitor-day-type="'product'" ng-if="prod.targetId"></monitor-day-component>
                        </td>
                    </tr>
                    <tr ng-if="vm.table.products.length == 0">
                        <td colspan="10">
                            暂无商品监控
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
